package com.yan.issm.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yan.issm.pojo.User;
import com.yan.issm.service.UserService;

@Controller  
@RequestMapping("/user")
public class UserController {

	@Resource  
    private UserService userService;  
      
    @RequestMapping("/showUser")  
    public String toIndex(HttpServletRequest request,Model model){  
       List<User> list = this.userService.findUserAll();
        model.addAttribute("list", list);
        for(User user : list) {
        	System.out.println(">>>>>>>>" + user.getUsername());
        }
        return "showUsers";  
    }
	
}
